import { createRouter, createWebHistory } from "vue-router";
import axios from "@/utils/axios";
const routes = [
  { path: "/", redirect: "/index/login" },
  {
    path: "/index",
    redirect: "/index/login",
  },
  {
    path: "/index/home",
    component: () => import("@/view/home/home.vue"),
    name: "home",
    meta: {
      title: "产品中心",
    },
  },
  {
    path: "/index/login",
    component: () => import("@/view/login/login.vue"),
    name: "login",
    meta: {
      title: "登录",
    },
  },
  {
    path: "/index/person",
    name: "person",
    component: () => import("@/view/person/person.vue"),
    meta: {
      title: "个人中心",
    },
    children: [
      {
        path: "orderPay",
        name: "orderPay",
        meta: {
          title: "订单支付",
          parentName: "订单管理",
        },
        component: () => import("@/view/person/order.vue"),
      },
      {
        path: "markDetail",
        name: "markDetail",
        meta: {
          title: "批单详情",
          parentName: "批单详情",
        },
        component: () => import("@/view/person/markDetail.vue"),
      },
      {
        path: "setpsd",
        name: "setpsd",
        meta: {
          title: "修改密码",
        },
        component: () => import("@/view/person/setPsd.vue"),
      },
      {
        path: "achievement",
        name: "achievement",
        meta: {
          title: "我的业绩",
        },
        component: () => import("@/view/person/achievement.vue"),
      },
    ],
  },
  {
    path: "/index/detail",
    component: () => import("@/view/home/detail/detail.vue"),
    name: "投保详情",
    meta: {
      title: "投保详情",
    },
  },
  {
    path: "/index/detail/pay",
    component: () => import("@/view/home/detail/pay.vue"),
    name: "建工一切支付",
    meta: {
      title: "建工一切支付",
    },
  },
  {
    path: "/index/notice",
    component: () => import("@/view/home/noticeList.vue"),
    name: "公告列表",
    meta: {
      title: "公告列表",
    },
  },
  {
    path: "/index/noticeDetail",
    component: () => import("@/view/home/noticeDetail.vue"),
    name: "公告详情",
    meta: {
      title: "公告详情",
    },
  },
  {
    path: "/index/zj_dqyw",
    component: () => import("@/view/home/insure/zj/zj_dqyw.vue"),
    name: "紫金-短期意外险",
    meta: {
      title: "紫金短期意外险",
    },
  },
  {
    path: "/index/zj_dqyw/pay",
    component: () => import("@/view/home/insure/zj/pay.vue"),
    name: "紫金短期意外险待支付",
    meta: {
      title: "紫金-待支付",
    },
  },
  {
    path: "/index/zj_sxs",
    component: () => import("@/view/home/insure/zj_sxs/zj_sxs.vue"),
    name: "紫金-实习生意外险",
    meta: {
      title: "紫金实习生意外险",
    },
  },
  {
    path: "/index/zj_sxs/pay",
    component: () => import("@/view/home/insure/zj_sxs/pay.vue"),
    name: "紫金-实习生待支付",
    meta: {
      title: "紫金-实习生待支付",
    },
  },
  {
    path: "/index/zz_jgyq",
    component: () => import("@/view/home/insure/zz_jgyq/zz_jgyq.vue"),
    name: "枣庄年安建筑工程一切险专属",
    meta: {
      title: "枣庄年安建筑工程一切险专属",
    },
  },
  {
    path: "/index/zz_jgyq/pay",
    component: () => import("@/view/home/insure/zz_jgyq/pay.vue"),
    name: "枣庄年安建筑工程一切险专属待支付",
    meta: {
      title: "枣庄年安建筑工程一切险专属待支付",
    },
  },
  {
    path: "/index/zz_gz",
    component: () => import("@/view/home/insure/zz_gz/zz_gz.vue"),
    name: "枣庄公众责任险",
    meta: {
      title: "枣庄公众责任险",
    },
  },
  {
    path: "/index/zz_gz/pay",
    component: () => import("@/view/home/insure/zz_gz/pay.vue"),
    name: "枣庄公众责任险待支付",
    meta: {
      title: "枣庄公众责任险待支付",
    },
  },
  {
    path: "/index/dd_jgyq",
    component: () => import("@/view/home/insure/dd_jgyq/dd_jgyq.vue"),
    name: "大地建工一切险",
    meta: {
      title: "大地建工一切险",
    },
  },
  {
    path: "/index/dd_jgyq/pay",
    component: () => import("@/view/home/insure/dd_jgyq/pay.vue"),
    name: "大地建工一切险待支付",
    meta: {
      title: "大地建工一切险待支付",
    },
  },
  {
    path: "/index/dd_ccyqx",
    component: () => import("@/view/home/insure/dd_ccyqx/dd_ccyqx.vue"),
    name: "大地财产一切险",
    meta: {
      title: "大地财产一切险",
    },
  },
  {
    path: "/index/dd_ccyqx/pay",
    component: () => import("@/view/home/insure/dd_ccyqx/pay.vue"),
    name: "大地财产一切险待支付",
    meta: {
      title: "大地财产一切险待支付",
    },
  },
  {
    path: "/index/dd_gz",
    component: () => import("@/view/home/insure/dd_gz/dd_gz.vue"),
    name: "大地公众责任险",
    meta: {
      title: "大地公众责任险",
    },
  },
  {
    path: "/index/dd_gz/pay",
    component: () => import("@/view/home/insure/dd_gz/pay.vue"),
    name: "大地公众责任险待支付",
    meta: {
      title: "大地公众责任险待支付",
    },
  },
  {
    path: "/index/dd_jggzx",
    component: () => import("@/view/home/insure/dd_jggzx/dd_jggzx.vue"),
    name: "大地建工雇主险",
    meta: {
      title: "大地建工雇主险",
    },
  },
  {
    path: "/index/dd_jggzx/pay",
    component: () => import("@/view/home/insure/dd_jggzx/pay.vue"),
    name: "大地建工雇主险待支付",
    meta: {
      title: "大地建工雇主险待支付",
    },
  },
  {
    path: "/index/order/detail",
    component: () => import("@/view/person/detail/detail.vue"),
    name: "订单详情",
    meta: {
      title: "订单详情",
    },
  },
  {
    path: "/index/video/video",
    component: () => import("@/view/video/video.vue"),
    name: "video",
    meta: {
      title: "播放留痕",
    },
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
